<html>
<head>
    <css file="__PUBLIC__/css/body.css"/>
    <css file="__STATIC__/icon/icon.css"/>
    <js file="__STATIC__/jquery-1.7.2.min.js"/>
    <script>
        function gotopage(page){
            //window.location="{:U('Content/index',array('tag'=>$module['tag']),'',0)}/cid/"+page;
            window.location="{:U('Content/index',array('tag'=>$module['tag']),'',0)}&cid="+page;
        }
    </script>
    <style type="text/css">
        .query{float:left;margin:0px 10px;height:22px;}
        .query span{float:left;height:22px;line-height:22px;}
        .query select{float:left;height:22px;line-height:22px;width:150px;font-family:微软雅黑;font-size:12px;}
    </style>
</head>
<body>
<form action="{:U('Content/orders')}" method="post">
    <div class="top">
        <div class="position"><span class="icon icon-31"></span>当前位置：{$module.title}列表</div>
        <div class="top-title">
            <span class="icon icon-32"></span>
            <div class="top-tool">
                <a href="{:U('Content/add',array('tag'=>$module['tag']))}" class="button-a">添加{$module.title}</a>
                <input type="submit" class="button-b" value="保存排序"/>
                <div class="query">
                    <span>按分类查看：</span>
                    <select onchange="gotopage(this.options[this.selectedIndex].value)">
                        <option value="">请选择分类</option>
                        <foreach name="category" item="v">
                            {$mcid}
                             <option <if condition="$v['id'] eq $mcid">selected=""</if> value="{$v.id}">{$v.title}</option>
                        </foreach>
                    </select>
                    
                </div>
                <input type="hidden" name="tag" value="{$module['tag']}"/>
            </div>
        </div>
    </div>
    <div class="body">
        <table class="list-tb" border="0" cellpadding="0" cellspacing="4">
             <tr>
                    <th width="5%">排序</th>
                    <th width="5%">{$module.title}ID</th>
                    <foreach name="fields" item="vs">
                        <th><span>{$vs['title']}</span></th>
                    </foreach>
                    <th width="20%">所属分类</th>
                    <th width="15%">操作</th>
            </tr>
            <foreach name="list" item="v">
                <tr>
                    <td><input style="width:30px;text-align:center;" name='{$v["id"]}' value="{$v['orders']}"/></td> 
                    <td>{$v['id']}</td>
                    <foreach name="fields" item="vs">
                        <td><if condition="$v[$vs['tag']] eq NULL">&emsp;</if>{$v[$vs['tag']]}</td>
                    </foreach>
                    <td>{$v['category']['title']}</td>
                    <td class="operate">
                        <a href="{:U('Content/modify',array('tag'=>$module['tag'],'id'=>$v['id']))}"><span class="icon icon-43"></span>修改</a>
                        <a href="{:U('Content/delete',array('tag'=>$module['tag'],'id'=>$v['id']))}"><span class="icon icon-44"></span>删除</a>
                    </td>
                </tr>
            </foreach>
        </table>
        <div class="page">{$page}</div>
    </div>
</form>
</body>
</html>